import config from '@/config'
import { http } from '@/api/request'

export default {
    getClickCaptcha: {
        url: `${config.API_URL}/passport/getClickCaptcha`,
        name: '获取点击验证码',
        get: async function (data = {}, config = {}) {
            return http.get(this.url, data, config)
        }
    },
    getCaptcha: {
        url: `${config.API_URL}/passport/getCaptcha`,
        name: '获取验证码',
        get: async function (data = {}, config = {}) {
            return http.get(this.url, data, config)
        }
    },
    getToken: {
        url: `${config.API_URL}/passport/getToken`,
        name: '登录获取TOKEN',
        post: async function (data = {}, config = {}) {
            return http.post(this.url, data, config)
        }
    },
    refreshToken: {
        url: `${config.API_URL}/passport/refreshToken`,
        name: '刷新TOKEN',
        post: async function (data = {}, config = {}) {
            return http.post(this.url, data, config)
        }
    },
    logout: {
        url: `${config.API_URL}/passport/logout`,
        name: '退出登录',
        post: async function (data = {}, config = {}) {
            return http.post(this.url, data, config)
        }
    },
    forceLogout: {
        url: `${config.API_URL}/passport/forceLogout`,
        name: '强制注销',
        post: async function (data = {}, config = {}) {
            return http.post(this.url, data, config)
        }
    },
    getSysConfigByGuest: {
        url: `${config.API_URL}/passport/getSysConfigByGuest`,
        name: '获取系统非敏感配置项',
        get: async function () {
            return http.get(this.url)
        }
    },
    applySystemAdmin: {
        url: `${config.API_URL}/passport/applySystemAdmin`,
        name: '申请管理员',
        post: async function (data = {}, config = {}) {
            return http.post(this.url, data, config)
        }
    },
    getSystemMenu: {
        url: `${config.API_URL}/passport/getSystemMenu`,
        name: '登录获取菜单',
        get: async function (data = {}, config = {}) {
            return http.get(this.url, data, config)
        }
    }
}
